﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace VO
{
   public class SACH_VO
    {
        private string _MaS;

        public string MaS
        {
            get { return _MaS; }
            set { _MaS = value; }
        }
        private string _TenS;

        public string TenS
        {
            get { return _TenS; }
            set { _TenS = value; }
        }
        private string _Gia;

        public string Gia
        {
            get { return _Gia; }
            set { _Gia = value; }
        }
        private string _NXB;

        public string NXB
        {
            get { return _NXB; }
            set { _NXB = value; }
        }
        private string _NamXB;

        public string NamXB
        {
            get { return _NamXB; }
            set { _NamXB = value; }
        }
        private string _SL;

        public string SL
        {
            get { return _SL; }
            set { _SL = value; }
        }
        private string _SlMuon;

        public string SlMuon
        {
            get { return _SlMuon; }
            set { _SlMuon = value; }
        }
        public SACH_VO()
            {
            //HAM TAO KHONG THAM SO
            }
        public SACH_VO(string MaS, string TenS, string Gia, string NXB,string NamXB,string SL,string SlMuon )
        {
            this._MaS = MaS;
            this._TenS = TenS;
            this._Gia = Gia;
            this._NXB = NXB;
            this._NamXB = NamXB;
            this._SL = SL;
            this._SlMuon = SlMuon;            
        }
        public void CreateFrom(DataRow dr)
        {
            if (dr != null)
            {
                this._MaS = dr.IsNull(0) ? string.Empty : Convert.ToString(dr[0]);
                this._TenS = dr.IsNull(1) ? string.Empty : Convert.ToString(dr[1]);
                this._Gia = dr.IsNull(2) ? string.Empty : Convert.ToString(dr[2]);
                this._NXB = dr.IsNull(3) ? string.Empty : Convert.ToString(dr[3]);
                this._NamXB = dr.IsNull(4) ? string.Empty : Convert.ToString(dr[4]);
                this._SL = dr.IsNull(5) ? string.Empty : Convert.ToString(dr[5]);
                this._SlMuon = dr.IsNull(6) ? string.Empty : Convert.ToString(dr[6]);

            }
        }
   }
}
